package org.dbstar.scheduler.control.db.catalog;

import java.sql.Types;

import org.dbstar.scheduler.beans.Catalog;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.SqlParameter;


/**
 * 查询Root Catalog
 * 
 * @author 代波
 * @since 1.0.0
 * @version 1.0.0
 * @date 2012-4-21
 */
public class CataLogQueryByRoot extends CataLogQuery {
	public CataLogQueryByRoot(JdbcTemplate jdbcTemplate) {
		super(jdbcTemplate, "WHERE PARENT IS NULL AND NAME = ?");
		declareParameter(new SqlParameter("NAME", Types.VARCHAR));
	}

	public Catalog findRoot() throws DataAccessException {
		return super.findObject("root");
	}
}
